<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/style.css">
<title>LengdoFrame 安装向导!</title>
</head>

<body>


<div class="install-logo">
    <div class="logo"></div>
</div>

<div class="install-version"><?php echo $_LANG[sys_kernel]; ?></div>

<div class="install-main">
    <div class="install-main-header"></div>


    <div class="install-main-body">
    <form method="post" action="?step=<?php echo $tpl['step']; ?>">
        <div class="install-main-body-step">
            <i class="step step<?php echo $tpl['step']; ?>"></i>
            <div class="title">
                <b><?php echo $tpl['title']; ?></b><br />
                <span><?php echo $tpl['subtitle']; ?></span>
            </div>
        </div>

        <div class="install-main-body-line"></div>


        <?php if( $tpl['_body'] == 'envcheck' ){ ?>
            <br />

            <table class="envcheck-table" cellspacing="0" cellpadding="0">
            <tr>
                <td colspan="3"><b>目录、文件权限检查</b></td>
            </tr>
            <tr>
                <th width="60%" align="left">目录文件</th>
                <th width="20%">所需状态</th>
                <th width="20%">当前状态</th>
            </tr>
            <?php foreach( $tpl['files'] AS $i=>$r ){?>
            <tr align="center"<?php echo $r['error']==1 ? ' class="error"' : ''; ?>>
                <td align="left"><?php echo $r['url']; ?></td>
                <td class="opacity"><?php echo $r['need']; ?></td>
                <td><?php echo $r['filepriv']; ?></td>
            </tr>
            <?php }?>
            </table>

            <br /><br />

            <table class="envcheck-table" cellspacing="0" cellpadding="0">
            <tr>
                <td colspan="3"><b>函数依赖检查</b></td>
            </tr>
            <tr>
                <th width="60%" align="left">函数名称</th>
                <th width="20%">所需状态</th>
                <th width="20%">当前状态</th>
            </tr>
            <?php foreach( $tpl['funcs'] AS $i=>$r ){?>
            <tr align="center"<?php echo $r['error']==1 ? ' class="error"' : ''; ?>>
                <td align="left"><?php echo $r['func']; ?></td>
                <td class="opacity"><?php echo $r['need']; ?></td>
                <td><?php echo $r['support']; ?></td>
            </tr>
            <?php }?>
            </table>

            <br />


        <?php }elseif( $tpl['_body'] == 'dbcreate' ){ ?>
            <br />
            
            <?php if( $tpl['errors']['error'] ){?>
                <div class="dbcreate-error"><?php echo $tpl['errors']['error']; ?><br /></div><br />
            <?php }?>

            <table class="dbcreate-table">
            <tr>
                <td colspan="3"><b>填写数据库配置</b></td>
            </tr>
            <tr<?php echo $tpl['errors']['dbhost'] ? ' class="error"' : ''; ?>>
                <th width="25%">数据库服务器:</th>
                <td width="35%"><input type="text" class="textbox" name="dbhost" value="<?php echo isset($_POST['dbhost']) ? $_POST['dbhost'] : 'localhost'; ?>" /></td>
                <td width="40%" class="remark"><?php echo $tpl['remarks']['dbhost']; ?></td>
            </tr>
            <tr<?php echo $tpl['errors']['dbname'] ? ' class="error"' : ''; ?>>
                <th>数据库名:</th>
                <td><input type="text" class="textbox" name="dbname" value="<?php echo isset($_POST['dbname']) ? $_POST['dbname'] : ''; ?>" /></td>
                <td class="remark"><?php echo $tpl['remarks']['dbname']; ?></td>
            </tr>
            <tr<?php echo $tpl['errors']['dbuser'] ? ' class="error"' : ''; ?>>
                <th>数据库用户名:</th>
                <td><input type="text" class="textbox" name="dbuser" value="<?php echo isset($_POST['dbuser']) ? $_POST['dbuser'] : ''; ?>" /></td>
                <td class="remark"><?php echo $tpl['remarks']['dbuser']; ?></td>
            </tr>
            <tr>
                <th>数据库密码:</th>
                <td><input type="text" class="textbox" name="dbpass" value="<?php echo isset($_POST['dbpass']) ? $_POST['dbpass'] : ''; ?>" /></td>
                <td class="remark"><?php echo $tpl['remarks']['dbpass']; ?></td>
            </tr>
            <tr>
                <th>数据表前缀:</th>
                <td><input type="text" class="textbox" name="tblpre" value="<?php echo isset($_POST['tblpre']) ? $_POST['tblpre'] : ''; ?>" /></td>
                <td class="remark"><?php echo $tpl['remarks']['tblpre']; ?></td>
            </tr>
            </table>

            <br /><br />

            <table class="dbcreate-table">
            <tr>
                <td colspan="3"><b>填写管理员信息</b></td>
            </tr>
            <tr<?php echo $tpl['errors']['admin_username'] ? ' class="error"' : ''; ?>>
                <th width="25%">管理员账号:</th>
                <td width="35%"><input type="text" class="textbox" name="admin_username" value="<?php echo isset($_POST['admin_username']) ? $_POST['admin_username'] : 'administrator'; ?>" /></td>
                <td width="40%" class="remark"><?php echo $tpl['remarks']['admin_username']; ?></td>
            </tr>
            <tr<?php echo $tpl['errors']['admin_password'] ? ' class="error"' : ''; ?>>
                <th>管理员密码:</th>
                <td><input type="text" class="textbox" name="admin_password" value="<?php echo isset($_POST['admin_password']) ? $_POST['admin_password'] : ''; ?>" /></td>
                <td class="remark"><?php echo $tpl['remarks']['admin_password']; ?></td>
            </tr>
            <tr<?php echo $tpl['errors']['admin_name'] ? ' class="error"' : ''; ?>>
                <th>管理员姓名:</th>
                <td><input type="text" class="textbox" name="admin_name" value="<?php echo isset($_POST['admin_name']) ? $_POST['admin_name'] : ''; ?>" /></td>
                <td class="remark"><?php echo $tpl['remarks']['admin_name']; ?></td>
            </tr>
            </table>

            <br />

        <?php }elseif( $tpl['_body'] == 'complete' ){ ?>
            <br />

            <table class="complete-table">
            <tr>
                <td class="redirect">· <a href="<?php echo $tpl['redirect']; ?>">安装完成，点击进入</a></td>
            </tr>
            </table>

            <br />
        <?php } ?>


        <div class="install-main-body-line"></div>

        <div class="install-main-body-acts">
            <?php if( strpos($tpl['acts'],'p') !== false ){?>
                <input type="button" class="button" value="上一步" onclick="window.location.search = 'step=<?php echo $tpl['step']-1;?>';"/>
            <?php }?>

            <?php if( strpos($tpl['acts'],'n') !== false ){?>
            <input type="submit" name="submit" class="button" value="下一步" />
            <?php }?>

            <?php if( strpos($tpl['acts'],'c') !== false ){?>
            <input type="button" class="button" value="完 成" onclick="window.location.href='<?php echo $tpl['redirect']; ?>'" />
            <?php }?>
        </div>

    </form>
    </div>

    <div class="install-main-footer"></div>
</div>

</body>
</html>
